<jsp:directive.page contentType="text/html;charset=utf-8" />
<%@ include file="/taglibs.jsp" %>

<head>
<meta name="decorator" content="setup">
<title>Setup - Users</title>
<script type="text/javascript">
$(function() {
	$("#new" ).button();
	$("#new").click(function(){window.location='${ctx}/setup/user!editNew.action';});
});
$(document).ready(function(){
	jQuery("#list").jqGrid( {
		url : 'user!userJsonList.action',
		//search : {sopt : ['eq','ne']},
		jsonReader : {
			root : "rows", repeatitems : false, id : "0"},
		colNames : [ '<s:text name="module.common.id"/>',
					 '<s:text name="module.user.userName"/>', 
		 			 '<s:text name="module.user.isEnabled"/>', 
		 			 '<s:text name="module.user.preferedLanguage"/>',
		 			 '<s:text name="module.common.description"/>'],
		colModel : [ {name : 'id',index : 'id', width : 20, hidden:true}, 
					 {name : 'userName',index : 'userName', width : 120, 
							formatter:'showlink',formatoptions:{baseLinkUrl:'user!view.action',idName:'user.id'}},
		     		 {name : 'isEnabled',index : 'isEnabled',width : 120},
		     		 {name : 'preferedLanguage',sortable : false,width : 150},
		     		 {name : 'description',sortable : false, width : 250}],		
		rowNum : 15,
		rowList : [15,30,50],
		height: 'auto',
		pager : '#pager',
		sortname : 'userName',
		viewrecords: true,
		sortorder : 'asc',
		loadOnce : true,
		caption : "Users List",
		multiselect : true,
		editurl : 'user!jqgridOper.action',
		onSelectRow: function(ids) {
			if(ids == null) {
				alert();
			}
			//window.location='user!view.action?user.id='+ids;
		}
	});
	jQuery("#list").jqGrid('navGrid',"#pager",{edit:false,add:false,del:true,search:false,refresh:false},
			{reloadAfterSubmit:false}, // edit options
			{reloadAfterSubmit:false}, // add options
			{reloadAfterSubmit:false}, // del options
			{sField : "jq.searchField", sFilter : "jq.searchFilter", sOper : "jq.searchOper", sValue : "jq.searchString"});//search options
	jQuery("#list").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false});

});
</script>
</head>


<body>
<h1><s:text name="module.user"/> : <s:text name="module.user.allUsers"/></h1>
<button id="new"><s:text name="module.user.newUser"/></button>

<div>
<table id="list"></table>
<div id="pager"></div>
</div>



<script type="text/javascript">

</script>


</body>
